/*
 * @Author: 许旺玉
 * @Description: 购物车相关
 * @Date: 2020-06-28 15:33:14
 * @LastEditTime: 2020-07-03 10:04:06
 * @LastEditors: Please set LastEditors
 */ 
import { ajaxGet,ajaxPost,ajaxPut,ajaxDel} from '@/utlis/request.js'

export function cart(params) {  //购物车列表  
    const url = 'cart'
    return ajaxGet(url, params)
}

export function cart_selectone(data) { //商品勾选
    const url = 'cart/select'
    console.log(data)
    return ajaxPut(url, data)
}

export function cart_del(params) {  //删除  
    const url = `cart/${params}`
    return ajaxDel(url, params)
}

export function cart_num(data) { //商品更新数量
    const url = 'cart/682'
    return ajaxPut(url, data)
}

export function goCart(data) { //加入购物车
    const url = 'cart'
    return ajaxPost(url, data)
}

export function cart_count(params) {  //查询购物车商品数量  
    const url = 'cart/count'
    return ajaxGet(url, params)
}

export function cart_selecttow(params) {  //结算  
    const url = 'order/select'
    return ajaxGet(url, params)
}